<template>
  <div class="page" data-page="unitVRview" style="z-index: 2;">
    <div class="navbar vr-head">
      <div class="navbar-inner sliding">
                <div class="left">
                  <a href="#" class="link" @click="previousPage">
                    <i class="icon icon-back"></i>
                    <span class="ios-only">Back</span>
                  </a>
                </div>
            <div class="title sliding" style="left: -25px;">关于我们</div>
        </div>
    </div>
    <div id="aboutUsContent" class="page-content"> 
    </div>
  </div>
</template>
<script>
  return{
      methods: {
        previousPage:function(){
          let _iframe = document.getElementById('aboutUsIframe').contentWindow;
          if(_iframe.location.href.indexOf('index.html') > -1) {
              this.pageBeforeOut();
              app.methods.backToTab();
          }else{
            parent.frames["aboutUs"].history.back();
          }
        },

        pageBeforeOut:function() {
          //Do：方法销毁、内存释放
          jQuery('#aboutUsIframe').attr('src','about:blank');
          try {
            document.getElementById('aboutUsIframe').contentWindow.document.write('');
            document.getElementById('aboutUsIframe').contentWindow.document.clear();
          } catch (e) {
          }
          jQuery("#aboutUsContent")[0].childNodes[1].remove();
          //jQuery(jQuery("#aboutUsContent")[0]).removeChild($("#aboutUsIframe")[0].childNodes[1]);
        }
      },
      on: {
          pageInit: function (e, page){
              common.loading(1);
              var src  =staticPath+'kdlaAbout/index.html' /*'http://www.kdlayun.com/rdspHome/app'*/;
              var size = screen.height - $(".vr-head").height();
              setTimeout(function(){
                  jQuery("#aboutUsContent").append(`<iframe name="aboutUs" id="aboutUsIframe" scrolling="auto" style="width: 100%; height: 100%;" class="unitVRview-content"  src="`+src+`" frameborder="0" ></iframe>`);
                  common.loading(0);
              },100);
          },

      },
  }
</script>